// 用户模块
// import { findKnowledge } from '@/api/knowledge'
// import Message from '@/components/library/Message'
export default {
  namespaced: true,
  state () {
    return {
      // 书法知识列表
      knowledgeList: [],
      // 点击后的某一个书法知识
      KnowledgeDetailList: [],
      currentPage: 0
    }
  },
  mutations: {
    // 获取数据knowledgeList
    SETKNOWLEDGE (state, data) {
      state.knowledgeList = data
    },
    SETCURRENTPAGE (state, data) {
      state.currentPage = data
    },
    // 拼接数据KnowledgeDetail
    SETKNOWLEDGEDETAIL (state, KnowledgeDetail) {
      state.knowledgeList.forEach((item, index) => {
        item.detail = KnowledgeDetail[index]
      })
    },
    SETKNOWLEDGEDETAILLIST (state, KnowledgeDetailList) {
      state.KnowledgeDetailList = KnowledgeDetailList
    }
  },
  actions: {
    // 获取推荐的数据
    async setKnowledge (ctx) {

    }
  }
}
